package com.prs.crm.action.purchase.flow;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.courser.ui.PaginationSupport;

import com.prs.crm.action.FlowAction;
import com.prs.crm.annotation.Clew;
import com.prs.crm.context.AppContext;
import com.prs.crm.domain.purchase.SupplierInquiry;
import com.prs.crm.service.purchase.SupplierInquiryService;


public class SupplierInquiryFlowAction extends FlowAction<SupplierInquiry> {

	private static final long serialVersionUID = -3214407634942049006L;
	private PaginationSupport pagination;
	private SupplierInquiry supplierInquiry;
	private SupplierInquiryService supplierInquiryService;
	
	@Action("listSupplierInquiryFlow")
	public String listSupplierInquiry(){
		pagination = this.getPaginationHelper().prepare(pagination);
		pagination = this.getSupplierInquiryService().listFlowTask(SupplierInquiry.class, pagination, AppContext.getAccountContext().currentUser());
		return SUCCESS;
	}
	
	@Action("editSupplierInquiryFlow")
	public String editSupplierInquiryFlow(){
		this.displayEndNodes();
		return SUCCESS;
	}
	@Clew(results={"success"})
	@Action(value="submitSupplierInquiryFlow",results={@Result(name="success",type="redirect",location="listSupplierInquiryFlow")})
	public String submitSupplierInquiryFlow(){
		this.getSupplierInquiryService().execute(this.getNode(), this.getDetail(), supplierInquiry, AppContext.getAccountContext().currentUser());
		this.setPrompt("提交成功");
		return SUCCESS;
	}

	public PaginationSupport getPagination() {
		return pagination;
	}

	public void setPagination(PaginationSupport pagination) {
		this.pagination = pagination;
	}

	public SupplierInquiryService getSupplierInquiryService() {
		return supplierInquiryService;
	}

	public void setSupplierInquiryService(
			SupplierInquiryService supplierInquiryService) {
		this.supplierInquiryService = supplierInquiryService;
	}

	public SupplierInquiry getSupplierInquiry() {
		return supplierInquiry;
	}

	public void setSupplierInquiry(SupplierInquiry supplierInquiry) {
		this.supplierInquiry = supplierInquiry;
	}
	
	
	
}
